import api from '../../api';

export default {
  namespace: 'businessOrderM',
  state: {},
  effects: {
    // 簿记下达 新接口
    *saveOrderNew({ payload }, { call, put }) {
      const { tradeType } = payload;
      delete payload.tradeType; // 前端作为标记 不传递给后端
      const response = yield call(api.addOrderObj[tradeType], payload);
      return response;
    },
    // 验资验券 新接口
    *onCheck({ payload }, { call, put }) {
      const response = yield call(api.exchangeAgreement.onCheck, payload);
      return response;
    },
    // 验资验券 新接口
    *queryResult({ payload }, { call, put }) {
      const response = yield call(api.exchangeAgreement.queryResult, payload);
      return response;
    },
  },
  reducers: {
    save(state, { payload }) {
      return { ...state, ...payload };
    },
  },
};
